package com.yuyue.dronesystem.beans;

import java.util.Objects;

import com.yuyue.dronesystem.enums.BoxType;

/**
 * AidKit
 */
public class AidKit extends Box {

    // 重量（磅）
    private Double weight;

    public AidKit() {
    }

    public AidKit(Double weight) {
        this.weight = weight;
    }

    public AidKit(Double length, Double width, Double height, Double weight) {
        super(length, width, height, BoxType.AIDKIT);
        this.weight = weight;
    }

    public Double getWeight() {
        return this.weight;
    }

    public void setWeight(Double weight) {
        this.weight = weight;
    }

    public AidKit weight(Double weight) {
        this.weight = weight;
        return this;
    }

    @Override
    public boolean equals(Object o) {
        if (o == this)
            return true;
        if (!(o instanceof AidKit)) {
            return false;
        }
        AidKit aidKit = (AidKit) o;
        return super.equals((Box) o) && Objects.equals(weight, aidKit.weight);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), weight);
    }

    @Override
    public String toString() {
        return "{" +
            " box='" + super.toString() + "'" +
            ", weight='" + getWeight() + "'" +
            "}";
    }    
}